package com.hotel.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hotel.dao.CustomerMapper;
import com.hotel.entity.Customer;
import com.hotel.service.CustomerService;
@Service("customerService")
@Transactional("txManager")
public class CustomerServiceImpl implements CustomerService {

	@Resource
	private CustomerMapper customerMapper;
	@Override
	public int deleteByPrimaryKey(Integer customerId) {
		return customerMapper.deleteByPrimaryKey(customerId);
	}

	@Override
	public int insert(Customer record) {
		return customerMapper.insert(record);
	}

	@Override
	public Customer selectByPrimaryKey(Integer customerId) {
		return customerMapper.selectByPrimaryKey(customerId);
	}

	@Override
	public int updateByPrimaryKey(Customer record) {
		return customerMapper.updateByPrimaryKey(record);
	}

	@Override
	public List<Customer> findAllCustomer(Integer pageNo, Integer pageSize) {
		return customerMapper.findAllCustomer((pageNo-1)*pageSize, pageSize);
	}

	@Override
	public Customer findCustomerByzjNo(String zjNo) {
		return customerMapper.findCustomerByzjNo(zjNo);
	}

}
